<template>
	<view class="gs">
		<view class="header">
			<view class="header_top">
				<text style="font-size: 30rpx;font-weight: 600;color: #333333;">{{data.name}}</text>
				<text>企业类型：{{data.type}}</text>
				<text>工人数量：{{data.worker}}</text>
				<text>服务范围：</text>
				<text>业务范围：</text>
			</view>
			<view class="header_img">
			</view>
			<button type="default" @click="show" v-show="!showflag">▼</button>
		</view>

		<view class="center" v-show="showflag">
			<text>公司信息：</text>
			
			<text>公司地址：{{data.registered_address}}</text>

			<button type="default" @click="show" v-show="showflag">▲</button>
		</view>

		<view class="bottom">
			<view class="body" v-for="(item,index) in list" :key="index" @click="details(item.id)">
				<view class="body_left">
					<text style="background-color: #007AFF;">{{item.settlement_method}}</text>
				</view>
				<view class="body_right">
					<text style="color: #007AFF;">{{item.work_type}}</text>
					<text><text v-if="item.city!=false" style="display: inline;">{{item.city}} - {{item.area}}</text> | 招人 <text style="display: inline-block;margin-left: 20rpx;">发布</text></text>
					<text>{{item.company}}</text>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad(option) {
			this.data = JSON.parse(option.val)
			this.list = JSON.parse(option.list)
			console.log(this.list)
		},
		data() {
			return {
				data: "",
				showflag: false,
				list:[]
			}
		},
		methods: {
			show() {
				this.showflag = !this.showflag
			},

			details() {}
		}
	}
</script>

<style lang="less" scoped>
	.gs {
		width: 100vw;
		height: 100vh;
		background-color: #EEEEEE;
	}

	.header {
		display: flex;
		justify-content: space-between;
		position: relative;
		background-color: #FFFFFF;

		.header_top text {
			display: block;
			color: #808080;
			font-size: 28rpx;
			padding: 20rpx 40rpx;
		}

		.header_img {
			width: 30%;
			height: 200rpx;
			margin: 40rpx;
			background-color: #999999;
		}

		button {
			position: absolute;
			bottom: -20rpx;
			left: 50%;
			width: 100rpx;
			height: 50rpx;
			line-height: 50rpx;
			border: solid 2rpx #007AFF;
			transform: translate(-50%, -0%);
		}
	}

	.center {
		padding: 20rpx 40rpx;
		height: 300rpx;
		background-color: #FFFFFF;
		position: relative;
		text{
			display: block;
			color: #808080;
			font-size: 28rpx;
			padding: 20rpx 0;
		}

		button {
			position: absolute;
			bottom: -20rpx;
			left: 50%;
			width: 100rpx;
			height: 50rpx;
			line-height: 50rpx;
			border: solid 2rpx #007AFF;
			transform: translate(-50%, -0%);
		}
	}

	.bottom {
		margin-top: 20rpx;
		background-color: #FFFFFF;

		.body {
			width: 100vw;
			background-color: #FFFFFF;
			display: flex;
			justify-content: left;
			margin: 20rpx 0;
			padding: 20rpx 0;
			font-size: 28rpx;
			position: relative;

			.body_left {

				margin-left: 20rpx;

				text {
					display: block;
					padding: 4rpx 10rpx;
					margin-top: 10rpx;
					text-align: center;
					border-radius: 10rpx;
					background-color: #007AFF;
					color: #FFFFFF;
				}
			}

			.body_right {
				margin-left: 20rpx;

				text {
					margin-top: 10rpx;
					display: block;
				}

			}

		}
	}
</style>
